import requests
import json


def geocode(address,key="030d60847cc2dbf652a0d1f7e0fce690",city=None,batch=None,sig=None,callback=None):

    url = "https://restapi.amap.com/v3/geocode/geo?parameters"
    params = {
    "address":address,
    "key":key,
    "city":city,
    "batch":batch,
    "sig":sig,
    "callback":callback,
    }
    
    r = requests.get(url,params=params)
    results = r.json()
    return results

def around(location,types,key="030d60847cc2dbf652a0d1f7e0fce690"):
    """获取高德API的搜索POI——周边搜索"""
    around_url = "https://restapi.amap.com/v3/place/around"
    params = {
        "location":location,
        "types":types,
        "key":key,
    }
    r = requests.get(around_url,params=params)
    results = r.json()
    return results